import request from '@/utils/request'
import {imgUploadUrl} from './upload'
// 查询通用码规则
export function checkWxaPrefix() {
  return request({
    url: '/business_admin/qrcode/prefix/info',
    method: 'get'
  })
}

export function refreshWxaPrefix(data) {
  return request({
    url: '/business_admin/qrcode/prefix/refresh_wxa',
    method: 'post',
    data: data
  })
}

// 创建批次
export function createQrcodeTask(data) {
  return request({
    url: '/business_admin/qrcode/task/create',
    method: 'post',
    data: data
  })
}

// 查询批次列表
export function qrcodeTaskList(data) {
  return request({
    url: '/business_admin/qrcode/task/query',
    method: 'post',
    data: data
  })
}

// 变更批次状态
export function modifyQrcodeTaskStatus(params) {
  return request({
    url: '/business_admin/qrcode/task/status',
    method: 'post',
    params: params
  })
}

// 二维码列表
export function qrcodeList(data) {
  return request({
    url: '/business_admin/qrcode/base/query',
    method: 'post',
    data: data
  })
}

// 获取二维码图片
export function qrcodeImg(params) {
  return request({
    url: '/business_admin/qrcode/base/img',
    method: 'get',
    params: params
  })
}

// 解除绑定
export function unbindQrcode(params) {
  return request({
    url: '/business_admin/qrcode/base/unbind',
    method: 'delete',
    params: params
  })
}

// 获取微二维码带场景值
export function getWxQrCodeByScene(params) {
  return request({
    url: '/memberAdmin/member/wxAppQrcode',
    method: 'get',
    params: params
  })
}
// 上传图片到服务器中
export function upDataImage(data) {
  return request({
    url: imgUploadUrl,
    method: 'post',
    data: data
  })
}
